import Vue from 'vue'
import Router from 'vue-router'
import {routerMap} from './routes'

Vue.use(Router)
const scrollBehavior = (to, from, savedPosition) => {
  if (savedPosition) {
    return savedPosition
  } else {
    return { x: 0, y: 0 }
  }
}
const router = new Router({
  routes: routerMap,
  scrollBehavior
})
export default router
